﻿namespace Recast
{
    public class MethodModel
    {
        public string methodName;
        public string paramsName;
        public string returnName;
        public string methodBody;
        public string ctorBody;
        public string genericTypeName;
        public bool isStatic;
        public bool isDelegateSet;
        public bool isLnline;
        public bool isCtor;
        public bool isDelegate;
        public bool isGenericType;
        public bool isVirtual;

        public string Name => $"public {(isDelegate ? "delegate" : (isStatic ? "static" : ""))} {returnName} {methodName}{(isGenericType ? $"<{genericTypeName}>" : "")}{(isDelegateSet ? "" : $"({paramsName})")}";

        public override string ToString()
        {
            return $"public {(isDelegate ? "delegate" : (isStatic ? "static" : ""))} {returnName} {methodName}{(isGenericType ? $"<{genericTypeName}>" : "")}{(isDelegateSet ? "" : $"({paramsName})")}{ctorBody} {(isDelegate ? ";":"")}\r\n{methodBody}";
        }
    }
}
